package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TrainNotice generated by hbm2java
 */
@Entity
@Table(name = "train_notice")
public class TrainNotice implements java.io.Serializable {

	private Long id;
	private UserBaseInfo userBaseInfo;
	private String title;
	private String signer;
	private int userType;
	private Integer numberPeople;
	private String mainBody;
	private Date createDate;
	private int state;
	private Integer nature;
	private String copyTo;
	private String messageNumber;
	private Integer rank;
	private Boolean isSend;
	private String demand;
	private Set<MainPoint> mainPoints = new HashSet<MainPoint>(0);
	private Set<TeacherStudent> teacherStudents = new HashSet<TeacherStudent>(0);
	private Set<UserBaseInfoMainPoint> userBaseInfoMainPoints = new HashSet<UserBaseInfoMainPoint>(
			0);
	private Set<TrainNoticePart> trainNoticeParts = new HashSet<TrainNoticePart>(
			0);

	public TrainNotice() {
	}

	public TrainNotice(int userType, int state) {
		this.userType = userType;
		this.state = state;
	}

	public TrainNotice(UserBaseInfo userBaseInfo, String title, String signer,
			int userType, Integer numberPeople, String mainBody,
			Date createDate, int state, Integer nature, String copyTo,
			String messageNumber, Integer rank, Boolean isSend, String demand,
			Set<MainPoint> mainPoints, Set<TeacherStudent> teacherStudents,
			Set<UserBaseInfoMainPoint> userBaseInfoMainPoints,
			Set<TrainNoticePart> trainNoticeParts) {
		this.userBaseInfo = userBaseInfo;
		this.title = title;
		this.signer = signer;
		this.userType = userType;
		this.numberPeople = numberPeople;
		this.mainBody = mainBody;
		this.createDate = createDate;
		this.state = state;
		this.nature = nature;
		this.copyTo = copyTo;
		this.messageNumber = messageNumber;
		this.rank = rank;
		this.isSend = isSend;
		this.demand = demand;
		this.mainPoints = mainPoints;
		this.teacherStudents = teacherStudents;
		this.userBaseInfoMainPoints = userBaseInfoMainPoints;
		this.trainNoticeParts = trainNoticeParts;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SENDER")
	public UserBaseInfo getUserBaseInfo() {
		return this.userBaseInfo;
	}

	public void setUserBaseInfo(UserBaseInfo userBaseInfo) {
		this.userBaseInfo = userBaseInfo;
	}

	@Column(name = "TITLE", length = 100)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "SIGNER", length = 50)
	public String getSigner() {
		return this.signer;
	}

	public void setSigner(String signer) {
		this.signer = signer;
	}

	@Column(name = "USER_TYPE", nullable = false)
	public int getUserType() {
		return this.userType;
	}

	public void setUserType(int userType) {
		this.userType = userType;
	}

	@Column(name = "NUMBER_PEOPLE")
	public Integer getNumberPeople() {
		return this.numberPeople;
	}

	public void setNumberPeople(Integer numberPeople) {
		this.numberPeople = numberPeople;
	}

	@Column(name = "MAIN_BODY", length = 65535)
	public String getMainBody() {
		return this.mainBody;
	}

	public void setMainBody(String mainBody) {
		this.mainBody = mainBody;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_DATE", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "STATE", nullable = false)
	public int getState() {
		return this.state;
	}

	public void setState(int state) {
		this.state = state;
	}

	@Column(name = "NATURE")
	public Integer getNature() {
		return this.nature;
	}

	public void setNature(Integer nature) {
		this.nature = nature;
	}

	@Column(name = "COPY_TO", length = 200)
	public String getCopyTo() {
		return this.copyTo;
	}

	public void setCopyTo(String copyTo) {
		this.copyTo = copyTo;
	}

	@Column(name = "MESSAGE_NUMBER", length = 20)
	public String getMessageNumber() {
		return this.messageNumber;
	}

	public void setMessageNumber(String messageNumber) {
		this.messageNumber = messageNumber;
	}

	@Column(name = "RANK")
	public Integer getRank() {
		return this.rank;
	}

	public void setRank(Integer rank) {
		this.rank = rank;
	}

	@Column(name = "IS_SEND")
	public Boolean getIsSend() {
		return this.isSend;
	}

	public void setIsSend(Boolean isSend) {
		this.isSend = isSend;
	}

	@Column(name = "DEMAND", length = 65535)
	public String getDemand() {
		return this.demand;
	}

	public void setDemand(String demand) {
		this.demand = demand;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "train_notice_mainpoint", joinColumns = { @JoinColumn(name = "TRAIN_NOTICE_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "MAINPOINT_ID", nullable = false, updatable = false) })
	public Set<MainPoint> getMainPoints() {
		return this.mainPoints;
	}

	public void setMainPoints(Set<MainPoint> mainPoints) {
		this.mainPoints = mainPoints;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "trainNotice")
	public Set<TeacherStudent> getTeacherStudents() {
		return this.teacherStudents;
	}

	public void setTeacherStudents(Set<TeacherStudent> teacherStudents) {
		this.teacherStudents = teacherStudents;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "trainNotice")
	public Set<UserBaseInfoMainPoint> getUserBaseInfoMainPoints() {
		return this.userBaseInfoMainPoints;
	}

	public void setUserBaseInfoMainPoints(
			Set<UserBaseInfoMainPoint> userBaseInfoMainPoints) {
		this.userBaseInfoMainPoints = userBaseInfoMainPoints;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "trainNotice")
	public Set<TrainNoticePart> getTrainNoticeParts() {
		return this.trainNoticeParts;
	}

	public void setTrainNoticeParts(Set<TrainNoticePart> trainNoticeParts) {
		this.trainNoticeParts = trainNoticeParts;
	}

}
